package org.example.controller;

import jakarta.annotation.Resource;
import org.example.entity.RestBean;
import org.example.entity.dto.Ad;
import org.example.service.AdService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/ad")
public class AdController {
    @Resource
    AdService adService;

    @GetMapping("/get")
    public RestBean<List<Ad>> get() {
        return RestBean.success(adService.getAdList());
    }
}
